<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/page/common/common_header.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>排班规则详情</title>

<script src='${baseURL }/js/jquery.min.js'></script>
<script src='${baseURL }/js/common/addTab.js'></script>

<script type="text/javascript" src="http://10.0.250.52/uidev/package/js/itcui.dev.js"></script>
<link rel="stylesheet" type="text/css" href="http://10.0.250.52/uidev/package/css/itcui.dev.css" media="all"/>
<script type="text/javascript" src="http://10.0.250.52/uidev/package/source/thirdparty/js/jquery.validate.js"></script>

<!-- toolbar css  -->
<link rel="stylesheet" type="text/css" href="${baseURL }/css/base.css"
	media="all" />

<script>
	var fields = [
				{title : "规则编号", id : "ruleId",rules : {required:true}},
	  			{title : "规则名称", id : "ruleName",rules : {required:true}},
	  			{title : "值别", id : "zhibie",rules : {required:true},linebreak:true},
	  			{title : "值班电话", id : "phone"},
	  			{title : "排班班次", id : "banci",rules : {required:true},linebreak:true},
	  			{title : "轮换周期（班次）", id : "turns",rules : {required:true}},
	  			{title : "是否跨天", id : "isCrossDay",type:"checkbox",data:[['a','']],linebreak:true},
	  			{title : "横跨天数", id : "crossDayNum"}
	  		];
	var testData1 = [ {
		"day" : "1",
		"a" : "早班",
		"b" : "休息",
		"c":"休息",
		"d":"夜班",
		"e":"中班"
	}, {
		"day" : "2",
		"a" : "中班",
		"b" : "早班",
		"c":"休息",
		"d":"休息",
		"e":"夜班"
	}, {
		"day" : "3",
		"a" : "夜班",
		"b" : "中班",
		"c":"早班",
		"d":"休息",
		"e":"休息"
	}, {
		"day" : "4",
		"a" : "休息",
		"b" : "夜班",
		"c":"中班",
		"d":"早班",
		"e":"休息"
	}, {
		"day" : "5",
		"a" : "休息",
		"b" : "休息",
		"c":"夜班",
		"d":"中班",
		"e":"早班"
	}];
	
	
	var testData2 = [ {
		"zhibie" : "A值",
		"member" : "黄力为,冯柱态"
	}, {
		"zhibie" : "B值",
		"member" : "黄力为,冯柱态"
	}, {
		"zhibie" : "C值",
		"member" : "周保康,吴圣"
	}, {
		"zhibie" : "D值",
		"member" : "张三丰,张无忌"
	}, {
		"zhibie" : "E值",
		"member" : "东方不败,岳不群"
	} ];
	function autoform() {
		$("#autoform").ITC_Form({
			labelWidth : "4",
			validate : true
		}, fields);
	}
	function autoformf() {
		$("#autoform").ITC_Form({
			validate : true,
			fixLabelWidth : true
		}, fields);
	}

	$(document).ready(function() {
		autoform();
		var data = {
			"ruleId" : "100001",
			"ruleName" : "运行排班",
			"zhibie" : "A值,B值,C值,D值,E值",
			"phone" : "12345678",
			"banci" : "早班,中班,夜班,休息",
			"turns" : "1",
		}
		$("#autoform").ITC_Form("loaddata", data);

		$("#contentTb1").datagrid({
			"pagination" : false,
			"fitColumns" : true,
			"data" : testData1
		});

		$("#contentTb2").datagrid({
			"pagination" : false,
			"fitColumns" : true,
			"data" : testData2
		});

	});
</script>

</head>
<body class="ml12 mr12 mt12">
	<div id="content">
		<div class="toolbar" style="border-bottom: #5aa3d6 1px solid">
			<div class="row btn-group-sm">
					<button type="button" class="btn btn-default" onclick="closeTab()">关闭</button>
					<button type="button" class="btn btn-success">保存</button>
			</div>
		</div>
		<form id="autoform">
		</form>
		<div class="itcui_frm_grp_title" style="width:100%;clear:both;">
			<span class="itcui_frm_grp_title_txt">从排班起始日期开始的一个周期的排班</span>	
		</div>
		<table class="easyui-datagrid" style="clear: both" width="100%"
			cellspacing="0" id="contentTb1">
			<thead>
				<tr style="height: 24px">
					<!-- <th width="26" data-options="field:'id'">序号</th> -->
					<th width="80" data-options="field:'day'">天次</th>
					<th width="160" class="th_sortable" data-options="field:'a'">A值</th>
					<th width="160" class="th_sortable" data-options="field:'b'">B值</th>
					<th width="160" class="th_sortable" data-options="field:'c'">C值</th>
					<th width="160" class="th_sortable" data-options="field:'d'">D值</th>
					<th width="160" class="th_sortable" data-options="field:'e'">E值</th>
				</tr>
			</thead>
		</table>
		<div class="itcui_frm_grp_title" style="width:100%;clear:both;">
			<span class="itcui_frm_grp_title_txt">配置每个值别对应的人员信息</span>	
		</div>
		<table class="easyui-datagrid" style="clear: both" width="100%"
			cellspacing="0" id="contentTb2">
			<thead>
				<tr style="height: 24px">
					<!-- <th width="26" data-options="field:'id'">序号</th> -->
					<th width="60" data-options="field:'zhibie'">值别</th>
					<th width="160" class="th_sortable" data-options="field:'member'">值别人员</th>
				</tr>
			</thead>
		</table>
	</div>
</body>
</html>